<div class="main-div">
    <table cellpadding="3" cellspacing="1" class="table table-hover">
        <thead>
        <tr>
            <th>订单号</th>
            <th>商品名称</th>
            <th>商品图片</th>
            <th>商品规格</th>
            <th>商品数量</th>
            <th>商品单价</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach($order['goods_list'] as $k=>$v):?>
        <tr>
            <td>{$v.order_id}</td>
            <td>{$v.goods_name}</td>
            <td><?php echo showImage($v[sm_logo]);?></td>
            <td>
                <?php foreach($v['gaData'] as $k1=>$v1):?>
                {$v1.attr_name}:{$v1.attr_value}<br/>
                <?php endforeach?>
            </td>
            <td>{$v.goods_number}</td>
            <td>{$v.price}</td>
        </tr>
        <?php endforeach;?>
        </tbody>
    </table>

    <table cellspacing="1" cellpadding="3" class="table table-hover">
        <thead>
            <th>收货人</th>
            <th>收货电话</th>
            <th>收货地址</th>
            <th>快递单号</th>
            <th>订单总价</th>
            <th>下单时间</th>
            <th>状态</th>
        </thead>
        <tbody>
        <tr>
            <td>{$order.shr_name}</td>
            <td>{$order.shr_tel}</td>
            <td>
                <p>{$order.shr_name}[TEL:{$order.shr_tel}]</p>
                <p>{$order.shr_province}{$order.shr_city}{$order.shr_area}{$order.address}</p>
            </td>
            <td>{$order.post_number}</td>
            <td>￥{$order.total_price}</td>
            <td><?php echo date('Y-m-d H:i:s' , $v['addtime'])?></td>
            <td>
                <?php if($order['order_status']=='正常'):?>
                <?php if($order['pay_status']=='是'):?>
                <?php echo $order['post_status'] == 1 ? '已发货':($order['post_status'] == 2 ?'已签收':'未发货'); ?>
                <?php else:?>
                  <?php echo makeAlipayBtn($order['id'])?>
                <?php endif;?>
                <?php else:?>
                已取消
                <?php endif;?>
            </td>
        </tr>
        </tbody>
    </table>
    <form name="main_form" method="POST" action="__SELF__" enctype="multipart/form-data">
        <table cellspacing="1" cellpadding="3" width="100%">
            <tr>
                <td class="label">
                    订单状态:
                </td>
                <td>
                    <select <?php if($order['order_status'] =='关闭'):?>disabled<?php endif;?> name="order_status" class="form-control">
                            <option<?php if($order['order_status'] =='正常'):?> selected <?php endif;?> value="正常">正常</option>
                             <option<?php if($order['order_status'] =='关闭'):?> selected <?php endif;?> value="关闭">关闭</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="label">
                    支付状态
                </td>
                <td>
                    <input disabled value="<?php echo $order['pay_status'] == '是' ? '已支付':'未支付';?>"/>
                </td>
            </tr>
            <tr>
                <td class="label">
                    发货状态:
                </td>
                <td>
                    <select <?php if($order['post_status'] ==2):?> disabled <?php endif;?> name="post_status" class="form-control" >
                    <option <?php if($order['post_status']==0):?> selected <?php endif;?> value="0">未发货</option>
                    <option <?php if($order['post_status']==1):?> selected <?php endif;?> value="1">已发货</option>
                    <option <?php if($order['post_status']==2):?> selected <?php endif;?> value="2">已签收</option>
                        </select>
                </td>
            </tr>
            <tr>
                <td class="label">
                    快递单号
                </td>
                <td>
                    <input <?php if($order['post_status'] ==2):?> disabled <?php endif?> name="post_number" value="{$order.post_number}"
                    type="text" class="form-control" placeholder="请输入快递单号"/>
                </td>
            </tr>
            <?php if($order['post_status']==2):?>
            <tr colspan="2">
                <td  colspan="99" align="center">
                    <span style="font-size:30px;color:skyblue">该订单已经完成!</span>
                </td>
            </tr>
            <?php else:?>
            <tr>
                <td class="label">
                </td>
                <td colspan="99">
                    <input type="submit"  value="确定">
                    <input type="hidden" name="id" value="{$order.id}">
                </td>
            </tr>
            <?php endif;?>
            </table>
        </form>
</div>